<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "me_user".
 *
 * @property integer $id
 * @property string $username
 * @property string $auth_key
 * @property string $password_hash
 * @property string $password_reset_token
 * @property integer $role
 * @property integer $status
 * @property integer $last_login_at
 * @property string $my_code
 * @property string $login_ip
 * @property string $login_area
 * @property string $wxopenid
 * @property integer $froststatus
 * @property integer $created_at
 * @property integer $updated_at
 */
class MeUser extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'me_user';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['username', 'auth_key', 'password_hash', 'role', 'my_code', 'created_at', 'updated_at'], 'required'],
            [['role', 'status', 'last_login_at', 'froststatus', 'created_at', 'updated_at'], 'integer'],
            [['username', 'password_hash', 'password_reset_token'], 'string', 'max' => 255],
            [['auth_key', 'wxopenid'], 'string', 'max' => 32],
            [['my_code'], 'string', 'max' => 10],
            [['login_ip'], 'string', 'max' => 100],
            [['login_area'], 'string', 'max' => 50],
            [['username'], 'unique'],
            [['password_reset_token'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'username' => 'Username',
            'auth_key' => 'Auth Key',
            'password_hash' => 'Password Hash',
            'password_reset_token' => 'Password Reset Token',
            'role' => 'Role',
            'status' => 'Status',
            'last_login_at' => 'Last Login At',
            'my_code' => 'My Code',
            'login_ip' => 'Login Ip',
            'login_area' => 'Login Area',
            'wxopenid' => 'Wxopenid',
            'froststatus' => '冻结1,拉黑2',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }
}
